﻿using System;
using System.IO;

namespace GJXQGame
{
    /*
 * \filename	ChineseBase.cs	v1.0
 * \brief	   表格资源定义 表名与表中字段与Excel表定义一致
 *			  
 * \author	  zhufang(zhufang666@gmail.com)
 * \created	 2014/3/14 10:40:46
 */

    /**
     * \brief Chinese表结构定义
     */
    //public interface IDataBase<T> { T getKeyValue(); bool ParseData(BinaryReader reader);}
    public partial class ChineseBase : IDataBase<string>
    {
        public string TextID;		//文字ID
        public string Text;		//文字内容

        public ChineseBase() { }
        public string GetID() { return TextID; }

        public bool ParseData(BinaryReader reader)
        {
            try
            {
                {
                    byte[] buf = reader.ReadBytes(reader.ReadUInt16());
                    TextID = TableManager.Bytes2String(buf);
                }
                {
                    byte[] buf = reader.ReadBytes(reader.ReadUInt16());
                    Text = TableManager.Bytes2String(buf);
                }
            }
            catch
            {
                return false;
            }
            return true;
        }

    }
}
